package Work;

import java.util.Scanner;
import java.lang.Integer;

public class Pro3 {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		while (in.hasNextInt() || in.hasNextFloat()) {
			String str1 = "";
			if (in.hasNextInt()) {
				int num = in.nextInt();
				str1 = Integer.toString(num);
			} else if (in.hasNextFloat()) {
				float num = in.nextFloat();
				str1 = num + "";
			}
			int sum = 0;
			char a[] = str1.toCharArray();
			for (int i = 0; i < str1.length(); ++i) {
				if (a[i] >= '0' && a[i] <= '9') {
					int temp = a[i] - '0';
					sum += temp;
				}
			}
			System.out.println(sum);
		}
	}
}
